#pragma once

#include <string>
#include <memory>
#include "include/cef_parser.h"
#include "iguana\json.hpp"

using namespace std;

template<typename T>
T CefDictionary2Struct(CefRefPtr<CefDictionaryValue> value)
{
    T data = {};
    CefRefPtr<CefValue> dict = CefValue::Create();
    dict->SetDictionary(value);
    CefString sz = CefWriteJSON(dict,JSON_WRITER_DEFAULT);
    iguana::json::from_json0(data, sz.ToString().c_str());
    return data;
}